NET Email Validation
ValidateList(List<String>,List<ValidationOptions>) Method
Example 






KellermanSoftware.NetEmailValidation Namespace > EmailValidation Class > ValidateList Method : ValidateList(List<String>,List<ValidationOptions>) Method
Validate a list of emails synchronously using the passed in options
Syntax
'Declaration
 
Public Overloads Function ValidateList( _
   ByVal emailAddresses As System.Collections.Generic.List(Of String), _
   ByVal options As System.Collections.Generic.List(Of ValidationOptions) _
) As System.Collections.Generic.List(Of Result)
'Usage
 
Dim instance As EmailValidation
Dim emailAddresses As System.Collections.Generic.List(Of String)
Dim options As System.Collections.Generic.List(Of ValidationOptions)
Dim value As System.Collections.Generic.List(Of Result)
 
value = instance.ValidateList(emailAddresses, options)
public System.Collections.Generic.List<Result> ValidateList( 
   System.Collections.Generic.List<string> emailAddresses,
   System.Collections.Generic.List<ValidationOptions> options
)
public function ValidateList( 
    emailAddresses: System.Collections.Generic.List;
    options: System.Collections.Generic.List
): System.Collections.Generic.List; 
public function ValidateList( 
   emailAddresses : System.Collections.Generic.List,
   options : System.Collections.Generic.List
) : System.Collections.Generic.List;
public: System.Collections.Generic.List<Result*>* ValidateList( 
   System.Collections.Generic.List<string*>* emailAddresses,
   System.Collections.Generic.List<ValidationOptions>* options
) 
public:
System.Collections.Generic.List<Result^>^ ValidateList( 
   System.Collections.Generic.List<String^>^ emailAddresses,
   System.Collections.Generic.List<ValidationOptions>^ options
) 

Parameters

emailAddresses
options
Example
EmailValidation emailValidator = new EmailValidation(); //Trial Mode
//EmailValidation emailValidator = new EmailValidation("place user name here", "place license key here"); //License Mode
 
emailValidator.FromEmail = "someone@somewhere.com";
emailValidator.FromMailServer = "mail.somewhere.com";
 
//Create a list of 100 email addresses 
List<string> emailAddresses = new List<string>();
 
for (int i = 1; i <= 100; i++)
    emailAddresses.Add(string.Format("johnsmith{0}@hotmail.com", i));
 
List<ValidationOptions> options = emailValidator.BestConnectionOptions();
 
//Validate synchronously
List<Result> results = emailValidator.ValidateList(emailAddresses, options);
 
//Print the log
foreach (Result myResult in results)
{
    Console.WriteLine(myResult.Log);
}
Dim emailValidator As EmailValidation = New EmailValidation() 'Trial Mode
'Dim emailValidator As EmailValidation = New EmailValidation("place user name here", "place license key here") 'License Mode
 
emailValidator.FromEmail = "someone@somewhere.com"
emailValidator.FromMailServer = "mail.somewhere.com"
 
'Create a list of 100 email addresses 
Dim emailAddresses As List(Of String) = New List(Of String)()
 
For i As Integer = 1 To 100
    emailAddresses.Add(String.Format("johnsmith{0}@hotmail.com", i))
Next i
 
Dim options As List(Of ValidationOptions) = emailValidator.BestConnectionOptions()
 
'Validate synchronously
Dim results As List(Of Result) = emailValidator.ValidateList(emailAddresses, options)
 
'Print the log
For Each myResult As Result In results
    Console.WriteLine(myResult.Log)
Next myResult
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EmailValidation Class
EmailValidation Members
Overload List